-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for moving cursor on spacebar slide. Fixes #91 #401
Conversation
After using this for a day I noticed that scrolling past text could move focus out of text field. Seems like DPAD is used for navigation between UI elements too, that's probably why this happens. Latest additions in 571fdc7 checks if length of text before / after cursor is 0. If there is no more text it aborts the movement and resets sliding offset. So far this is working great, and I have tested it in every application where the focus issue was present. That is Messenger, Teams and Snapchat. |
Oh wow, this looks awesome! I've wanted this feature for a while and was wondering how to implement it. |
Thanks @sslater11! Please take it for a test-drive if you get a chance. So far it's working great for me. |
571fdc7
to
9e8e8c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this is gonna be a great addition, thx for this!
The main thing that I commented on below, is that sliding might also be useful in the future for the delete key, so I'd rename it from spacebar_side
to something more generic.
app/src/main/java/com/dessalines/thumbkey/ui/components/keyboard/KeyboardKey.kt
Show resolved
Hide resolved
.../main/java/com/dessalines/thumbkey/ui/components/settings/lookandfeel/LookAndFeelActivity.kt
Outdated
Show resolved
Hide resolved
@dessalines thanks for the feedback! I agree that |
I haven't noticed that the spacebar wasn't being released until you mentioned it. Fixed it by calling the When this is merged I will try to look into "slide to delete". Didn't find an obvious way to implement that yet, and as I'm very new to android development things have a tendency to take some time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works great, thx!
I tried to tackle issue #91.
This pull request adds two settings:
Also
KeyItemC
was extended withslideType
. Slide type defaults toNONE
, which is the old behavior.MOVE_CURSOR
slide type is for keys meant to be used with the new "slide to move cursor"-functionality. The thought was to also extend this with another type.DELETE
, which marks characters backwards on slide and deletes them on release (like florissboard and Gboard). IfslideType
isMOVE_CURSOR
and the setting is turned off, spacebar will behave like it does now. In other words, this should not break default behavior.See gif for a simple demo
Not sure if these modifications are OK to you, but it seems to be working fine on my end now. I'm no Android developer, so any feedback is much welcome!